<template>
	<view class="my-radios">
		<view class="my-radios-item" :class="item.checked ? 'active' : ''" @tap="choose(index)" v-for="(item,index) in options" :key="index">{{item.name}}</view>
	</view>
</template>

<script>
	export default {
		// data() {
		// 	return {
		// 		currentIndex: 0
		// 	}
		// },
		props: {
			options: {
				type: Array,
				default: []
			},
			// currentIndex: {
			// 	type: Number,
			// 	default: 0
			// }
		},
		onLoad() {
			
		},
		
		methods: {
			choose(index) {
				// this.currentIndex = index
				this.$emit('choose', index)
			},
		}
	}
</script>

<style>
	.my-radios {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 30rpx 0;
	}
	
	.my-radios-item {
		padding: 10rpx 30rpx;
		border: 1rpx solid #C0C0C0;
		border-radius: 36rpx;
	}
	
	.active {
		background-color: #FF3333;
		border-color: #FF3333;
	}
</style>
